package cn.qf.service.impl;

import cn.qf.dao.UserDao;
import cn.qf.dao.impl.UserDaoImpl;
import cn.qf.pojo.PageBean;
import cn.qf.pojo.User;
import cn.qf.service.UserService;

import java.sql.SQLException;
import java.util.List;

public class UserServiceImpl implements UserService {
    @Override
    public List<User> findAllUser() {
        try {
            UserDao userDao = new UserDaoImpl();
            User user=userDao.selectAllUser();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public User findUserByUid(String uid){
        try {
            UserDao userDao=new UserDaoImpl();
            User user=userDao.selectUserById(uid);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public void updateUser(User user) {
        try {
            //调用接口数据
            UserDao userDao = new UserDaoImpl() ;
            //影响行数
            int count = userDao.update(user) ;
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return;
    }

    @Override
    public void deleteUser(String uid) {
        //调用用户数据访问接口
        try {
            UserDao userDao=new UserDaoImpl();
            int i=userDao.deletUserById(uid);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    @Override
    public PageBean<User> findUserByPage(int currentPage, int pageSize) {
        return null;
    }
}



